import React, { Component } from "react";
import { Button } from "antd";
// import echarts from "echarts";
// import data from "base";
import { Bar } from "myEchart";

import "../index.less";

class Home extends Component {
    constructor(props) {
        super(props);
        this.myLine = null;
    }
    state = {
        current: "mail"
    };
    componentDidMount() {
        this.myLine = new Bar(
            document.getElementById("Amonitor"),
            [
                {
                    name: "2",
                    data: []
                    // data: [820, 932, 100, 934, 1290, 1330, 1320]
                }
            ],
            ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
        );
    }
    update = () => {
        this.myLine.setData({
            name: "2",
            data: [1010, 832, 400, 934, 1290, 1330, 1320]
        });
    };
    render() {
        return (
            <div className="home base">
                <Button onClick={this.update}></Button>
                <div id="Amonitor" />
            </div>
        );
    }
}

export default Home;
